<?php include_once("functions/header.php");
	  include("functions/conn.php");      ?>

  <div class="bar">
  	<h3>Most Viewed</h3>
    <div id="mostViewed" class="scroll">
	  <?php $request=mysql_query("select * from expositions;",$connexion);
      $nb=mysql_num_rows($request);
      if ($nb!=0)
      while ($ligne=mysql_fetch_array($request) ){?>
      <h4><?php echo($ligne['title']) ?></h4>
      <a href="exposition.php?id=<?php echo($ligne['Id_exposition']) ?>">
        <img src="assets/<?php echo($ligne['img']) ?>" alt="<?php echo($ligne['title']) ?>" />
      </a>
      <?php } ?>
    </div>
  </div>
  <div class="content">
  	<h2>Welcome</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque dictum, lorem quis semper pulvinar, turpis urna fringilla erat, in gravida augue sem a enim. Vestibulum odio metus, tempus sit amet fermentum cursus, pretium nec quam. In eu lacus eget tellus rhoncus blandit. Curabitur quis viverra nisl. Nam semper nisi diam, non placerat mauris. Vivamus sed convallis odio. Sed eros orci, porta at convallis feugiat, tempus in ante.</p>
    <ul>
    	<li><a href="#">Expositions</a></li>
    	<li><a href="#">Statistics</a></li>
    </ul>    
  </div>
  <div id="lastAdded" class="bar">
  	<h3>Last Added</h3>
    <div class="scroll">
	  <?php $request=mysql_query("select * from expositions ORDER BY title;",$connexion);
      $nb=mysql_num_rows($request);
      if ($nb!=0)
      while ($ligne=mysql_fetch_array($request) ){?>
    	<h4><?php echo($ligne['title']) ?></h4>
      <a href="exposition.php?id=<?php echo($ligne['Id_exposition']) ?>">
        <img src="assets/<?php echo($ligne['img']) ?>" alt="<?php echo($ligne['title']) ?>" />
      </a>
      <?php } ?>
    </div>
  </div>

<?php include_once("functions/foot.php") ?>
